#include "SFML/System.hpp"
#include "SFML/Graphics.hpp"

class Animation
{
public:
					Animation(void);
					~Animation(void);
	void			Animation::initSelectMode(int fps);
	void			Animation::runSelectMode(sf::RenderWindow *window);

private:
	float			x_start;
	float			y_start;

	sf::Texture		textures[6];
	sf::Sprite		sprites[6];

	enum			{MUSH, TUBE, M1, M2, M3, M4};
	enum			{UP, RIGHT, DOWN, LEFT};

	int				fps;
	double			framerate;
	int				total_frames;
	int				length; // in seconds

	unsigned int	laps;
	unsigned int	rate;

	unsigned int	mario_laps;
	unsigned int	mario_sel;

	void			Animation::up(sf::Sprite &sprite, unsigned int rate);
	void			Animation::right(sf::Sprite &sprite, unsigned int rate);
	void			Animation::down(sf::Sprite &sprite, unsigned int rate);
	void			Animation::left(sf::Sprite &sprite, unsigned int rate);

	void			Animation::draw(sf::RenderWindow *window, unsigned int sprite);
	void			Animation::loadTexture(int id, char *file);
	void			Animation::move(unsigned int move, unsigned int sprite, unsigned int rate=0);
	void			Animation::mushAnim(sf::RenderWindow *window);
	void			Animation::setOrigins(void);
	void			Animation::resetSprites(void);
	
};
